-
Notifications
You must be signed in to change notification settings - Fork 33
update python SDK #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nofel-scale
commented
Feb 10, 2021
- Update README
- add Project API support
- expand batch API support
- update supported task types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the additions here, especially appreciate the extra tests, but we'll want to bring some of them back likely and add ones for the create_imageannotation_task
type of methods.
README.md
Outdated
=================== | ||
Scale AI | Python SDK | ||
=================== | ||
|
||
# Installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file wasn't markdown before - we need to either change the syntax from the .rst
file to .md
, or save the file again as an .rst file.
The internet does make a reasonably strong case for documenting Python SDKs in .rst
https://eli.thegreenplace.net/2017/restructuredtext-vs-markdown-for-technical-documentation/
https://www.zverovich.net/2016/06/16/rst-vs-markdown.html#:~:text=Both%20are%20lightweight%20markup%20languages,So%20what%20are%20the%20differences%3F
But we're still pretty light-weight and I think 99% of the engineers here just use Markdown.. I'll let you figure out the lift and pros / cons of converting everything.
README.md
Outdated
|
||
client.get_batch( batch_name = "batch_name_01_07_2021" ) | ||
|
||
## List Batchs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/sp batchs -> batches
scaleapi/__init__.py
Outdated
TASK_TYPES = [ | ||
'annotation', | ||
'audiotranscription', | ||
'categorization', | ||
'comparison', | ||
'cuboidannotation', | ||
'datacollection', | ||
'imageannotation', | ||
'lineannotation', | ||
'namedentityrecognition', | ||
'pointannotation', | ||
'polygonannotation', | ||
'segmentannotation', | ||
'transcription', | ||
'documenttranscription', | ||
'videoannotation', | ||
'videoboxannotation', | ||
'videocuboidannotation' | ||
'videoplaybackannotation', | ||
'namedentityrecognition', | ||
'textcollection', | ||
'documentmodel' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nofel-scale you're actually missing a big part of why this array exists.
At the bottom of init.py, we have:
def _AddTaskTypeCreator(task_type):
def create_task_wrapper(self, **kwargs):
return self.create_task(task_type, **kwargs)
setattr(ScaleClient, 'create_' + task_type + '_task', create_task_wrapper)
for taskType in TASK_TYPES:
_AddTaskTypeCreator(taskType)
This allows the client to have client.create_imageannotation_task
as a method, plus all the other task types. You can still use the raw create_task
method for things like Lidar if you wanted, but we should call out in the readme that these other functions do exist. (You removed it for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great - thanks @nofel-scale